from django.contrib import admin
from django.urls import path,include,re_path
from . import views
urlpatterns = [
    # 路由映射公式：请求方式 + 请求路径 = 视图函数
    # GET + //usernames/<username>/count/ = UsernameCountView.get视图函数


    # 判断用户名重复
    re_path(r'usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/',views.UsernameCountView.as_view()),
    # 判断手机号重复
    re_path(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$',views.MobileCountView.as_view()),

    path('register/', views.RegisterView.as_view()),

    path('login/',views.LoginView.as_view()),

    path('logout/',views.LogoutView.as_view()),

    path('info/',views.UserInfoView.as_view()),
]